/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package introse1;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Trisha
 */
public class PassManager {
    
    public boolean checkPass(String user, String pass) {
        
        boolean result = false;
        int i = 1;
  
        DBConnect con = new DBConnect();
        Connection konekta = con.connect();
        PreparedStatement pstmt;
        ResultSet res;
            try{
                pstmt = konekta.prepareStatement("Select username from user_accounts Where password = ? AND username = ?");
                pstmt.setString(1, pass);
                pstmt.setString(2, user);
                res = pstmt.executeQuery();
            
              if(res.next()){
                    con.close();
                  result = true;

                }
                else{
                System.out.println("Error!");
                }
        }catch(Exception e){

        } return result;
    }
    
    
private static change_password password;

}
